/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80031 (8.0.31)
 Source Host           : localhost:3306
 Source Schema         : db_wdm

 Target Server Type    : MySQL
 Target Server Version : 80031 (8.0.31)
 File Encoding         : 65001

 Date: 06/03/2023 23:02:52
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for ems_category
-- ----------------------------
DROP TABLE IF EXISTS `ems_category`;
CREATE TABLE `ems_category` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '类别名称',
  `note` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '类别描述',
  `state` tinyint(1) DEFAULT '1' COMMENT '类别状态',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='仓库信息表';

-- ----------------------------
-- Records of ems_category
-- ----------------------------
BEGIN;
INSERT INTO `ems_category` (`id`, `name`, `note`, `state`) VALUES (1, '上装', '描述', 1);
INSERT INTO `ems_category` (`id`, `name`, `note`, `state`) VALUES (2, '下装', '描述', 1);
INSERT INTO `ems_category` (`id`, `name`, `note`, `state`) VALUES (5, '套衫', '描述', 1);
INSERT INTO `ems_category` (`id`, `name`, `note`, `state`) VALUES (6, '鞋帽', '描述', 1);
INSERT INTO `ems_category` (`id`, `name`, `note`, `state`) VALUES (7, '服饰', '描述', 1);
COMMIT;

-- ----------------------------
-- Table structure for ems_certificate
-- ----------------------------
DROP TABLE IF EXISTS `ems_certificate`;
CREATE TABLE `ems_certificate` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '序号',
  `uid` int NOT NULL COMMENT '用户id',
  `pid` int DEFAULT NULL COMMENT '商品id',
  `input_flag` tinyint(1) DEFAULT '0' COMMENT '出入库标识（0:入库 1 出库）',
  `import_port` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '进口口岸',
  `import_date` datetime DEFAULT NULL COMMENT '进口日期',
  `operating_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '经营单位',
  `transportation_mode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '运输方式',
  `transport_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '运输工具名称',
  `shipping_country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '起运国',
  `container` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '集装箱号 ',
  `audit_flag` tinyint NOT NULL DEFAULT '0' COMMENT '审核（0:提交 1:通过 2:拒绝）',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `uid` (`uid`) USING BTREE,
  CONSTRAINT `ems_certificate_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='入库单/出库单（凭证）';

-- ----------------------------
-- Records of ems_certificate
-- ----------------------------
BEGIN;
INSERT INTO `ems_certificate` (`id`, `uid`, `pid`, `input_flag`, `import_port`, `import_date`, `operating_unit`, `transportation_mode`, `transport_name`, `shipping_country`, `container`, `audit_flag`) VALUES (1, 34, 0, 0, '口岸11', '2023-02-01 00:00:00', '单位222', '运输方式111', '高铁', '美国', 'ddd-22', 1);
INSERT INTO `ems_certificate` (`id`, `uid`, `pid`, `input_flag`, `import_port`, `import_date`, `operating_unit`, `transportation_mode`, `transport_name`, `shipping_country`, `container`, `audit_flag`) VALUES (2, 34, 0, 0, '口岸11', '2023-02-01 00:00:00', '单位222', '运输方式111', '高铁', '美国', 'ddd-22', 0);
INSERT INTO `ems_certificate` (`id`, `uid`, `pid`, `input_flag`, `import_port`, `import_date`, `operating_unit`, `transportation_mode`, `transport_name`, `shipping_country`, `container`, `audit_flag`) VALUES (10, 1, 0, 0, '深圳', '2023-02-14 00:00:00', 'wdm', '水路', '海盗王号', '泰国', 'sl123456', 1);
INSERT INTO `ems_certificate` (`id`, `uid`, `pid`, `input_flag`, `import_port`, `import_date`, `operating_unit`, `transportation_mode`, `transport_name`, `shipping_country`, `container`, `audit_flag`) VALUES (11, 34, 2, 0, '123', '2023-02-06 00:00:00', '222', '33', '23', '23', '23', 0);
INSERT INTO `ems_certificate` (`id`, `uid`, `pid`, `input_flag`, `import_port`, `import_date`, `operating_unit`, `transportation_mode`, `transport_name`, `shipping_country`, `container`, `audit_flag`) VALUES (12, 34, NULL, 1, '测试出库口岸11', '2023-03-03 00:00:00', '单位11', '2323', '2323', '232', '323232', 1);
COMMIT;

-- ----------------------------
-- Table structure for ems_movement
-- ----------------------------
DROP TABLE IF EXISTS `ems_movement`;
CREATE TABLE `ems_movement` (
  `id` int NOT NULL AUTO_INCREMENT,
  `source_id` int NOT NULL COMMENT '源仓库',
  `target_id` int NOT NULL COMMENT '目标仓库',
  `specification` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '规格',
  `packaging` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '包装',
  `quantity` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '数量',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='移动仓库记录表';

-- ----------------------------
-- Records of ems_movement
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for ems_order
-- ----------------------------
DROP TABLE IF EXISTS `ems_order`;
CREATE TABLE `ems_order` (
  `id` int NOT NULL AUTO_INCREMENT,
  `pid` int DEFAULT NULL COMMENT '商品id',
  `count` int NOT NULL COMMENT '商品数量',
  `cid` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '客户id',
  `state` tinyint(1) DEFAULT '1' COMMENT '出入库',
  `specification` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '规格',
  `packaging` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '包装',
  `remark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '备注',
  `audit_flag` tinyint NOT NULL DEFAULT '0' COMMENT '审核（0:提交 1:通过 2:拒绝）',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `create_by` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '创建人',
  `certificate_id` int NOT NULL COMMENT '出入库单编号',
  `shelf` tinyint NOT NULL DEFAULT '0' COMMENT '货架类型',
  `extraction_code` varchar(255) DEFAULT NULL COMMENT '取货码',
  `express_code` varchar(255) DEFAULT NULL COMMENT '快递单号',
  `express_name` varchar(255) DEFAULT NULL COMMENT '快递公司名称',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `fk_ems_order_ems_product` (`pid`) USING BTREE,
  KEY `fk_ems_order_ems_certificate` (`certificate_id`) USING BTREE,
  CONSTRAINT `fk_ems_order_ems_certificate` FOREIGN KEY (`certificate_id`) REFERENCES `ems_certificate` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_ems_order_ems_product` FOREIGN KEY (`pid`) REFERENCES `ems_product` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='入库凭证/出库通知单 信息';

-- ----------------------------
-- Records of ems_order
-- ----------------------------
BEGIN;
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (5, 2, 100, '1', 1, NULL, NULL, NULL, 1, '2022-02-21 20:47:56', 'admin', 0, 0, '234234bsbs', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (8, 1, 1, '1', 0, NULL, NULL, '12132123', 1, '2022-02-25 11:27:18', 'admin', 0, 0, '234234bsbs', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (9, 1, 100, '1', 1, NULL, NULL, NULL, 1, '2022-02-25 11:29:00', 'admin', 0, 0, '234234bsbs', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (17, 2, 100, '34', 0, NULL, NULL, '666', 2, '2022-02-26 11:19:53', 'admin', 0, 0, '234234bsbs', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (18, 2, 100, '34', 0, NULL, NULL, '777', 2, '2022-02-26 11:19:53', 'admin', 1, 0, '234234bsbs', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (21, 5, 11, '34', 0, NULL, NULL, '333', 2, '2022-02-28 16:44:55', 'admin', 0, 0, '234234bsbs', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (22, 3, 100, '34', 0, NULL, NULL, '', 1, '2023-01-25 08:07:49', 'admin', 0, 0, '234234bsbs', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (23, 5, 234, '34', 0, '234', '24', '234', 1, '2023-02-05 15:25:05', 'admin', 1, 0, '234234bsbs', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (24, 2, 22, '34', 0, '212', '112', 'qwe', 1, '2023-02-18 01:33:23', 'admin', 1, 2, '234234bsbs', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (25, 7, 22, '34', 0, '12', '12', NULL, 3, '2023-02-18 01:34:21', 'admin', 1, 0, '234234bsbs', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (26, 6, 22, '34', 0, '2', '2', '2', 1, '2023-02-18 02:52:39', 'admin', 1, 1, '234234bsbs', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (27, 1, 2, '34', 0, '12', '12', '测试111', 0, '2023-03-01 11:32:22', 'admin', 1, 2, 'E2UDXBR5', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (28, 2, 200, '34', 1, '323', '22', NULL, 3, '2023-03-01 11:53:21', 'admin', 12, 0, '4PGGFWHP', '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (29, 2, 12, '34', 1, '22', '23', NULL, 0, '2023-03-02 05:32:24', 'rourou', 12, 0, NULL, '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (30, 8, 122, '34', 0, '2', '2', '2', 3, '2023-03-02 05:52:51', 'rourou', 1, 0, NULL, '773210133644643', '申通快递');
INSERT INTO `ems_order` (`id`, `pid`, `count`, `cid`, `state`, `specification`, `packaging`, `remark`, `audit_flag`, `create_time`, `create_by`, `certificate_id`, `shelf`, `extraction_code`, `express_code`, `express_name`) VALUES (31, 8, 122, '34', 1, '21', '21', NULL, 3, '2023-03-02 06:05:05', 'rourou', 12, 0, 'PQL75QKB', '773210133644643', '申通快递');
COMMIT;

-- ----------------------------
-- Table structure for ems_product
-- ----------------------------
DROP TABLE IF EXISTS `ems_product`;
CREATE TABLE `ems_product` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '商品名称',
  `category_id` int DEFAULT NULL COMMENT '商品类别',
  `note` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '商品描述',
  `state` tinyint(1) DEFAULT '1' COMMENT '商品状态',
  `minimum` int NOT NULL DEFAULT '100' COMMENT '库存最小值',
  `maximum` int NOT NULL DEFAULT '999' COMMENT '库存最大值',
  `balance` int DEFAULT '0' COMMENT '库存',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `fk_ems_product_ems_category` (`category_id`) USING BTREE,
  CONSTRAINT `fk_ems_product_ems_category` FOREIGN KEY (`category_id`) REFERENCES `ems_category` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='仓库信息表';

-- ----------------------------
-- Records of ems_product
-- ----------------------------
BEGIN;
INSERT INTO `ems_product` (`id`, `name`, `category_id`, `note`, `state`, `minimum`, `maximum`, `balance`) VALUES (1, '白色兔子短袖', 1, '', 1, 100, 999, -100);
INSERT INTO `ems_product` (`id`, `name`, `category_id`, `note`, `state`, `minimum`, `maximum`, `balance`) VALUES (2, '红色墨镜', 2, '', 1, 100, 999, -756);
INSERT INTO `ems_product` (`id`, `name`, `category_id`, `note`, `state`, `minimum`, `maximum`, `balance`) VALUES (3, '加绒长裤', 2, '产品需要储存在东北地区', 1, 100, 999, 100);
INSERT INTO `ems_product` (`id`, `name`, `category_id`, `note`, `state`, `minimum`, `maximum`, `balance`) VALUES (5, '运动套装', 5, '当季服装热销', 1, 10, 999, 0);
INSERT INTO `ems_product` (`id`, `name`, `category_id`, `note`, `state`, `minimum`, `maximum`, `balance`) VALUES (6, '鸭舌帽', 6, '位于广东附近', 1, 11, 999, 166);
INSERT INTO `ems_product` (`id`, `name`, `category_id`, `note`, `state`, `minimum`, `maximum`, `balance`) VALUES (7, '自定义商品1', 5, NULL, 1, 12, 999, 44);
INSERT INTO `ems_product` (`id`, `name`, `category_id`, `note`, `state`, `minimum`, `maximum`, `balance`) VALUES (8, '测试衣服', 2, '测试衣服zcc', 1, 100, 999, 0);
COMMIT;

-- ----------------------------
-- Table structure for ems_retake
-- ----------------------------
DROP TABLE IF EXISTS `ems_retake`;
CREATE TABLE `ems_retake` (
  `id` int NOT NULL AUTO_INCREMENT,
  `oid` int NOT NULL COMMENT '订单id',
  `des` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '描述',
  `audit_flag` tinyint NOT NULL DEFAULT '0' COMMENT '审核状态',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `fk_ems_retake_ems_order` (`oid`) USING BTREE,
  CONSTRAINT `fk_ems_retake_ems_order` FOREIGN KEY (`oid`) REFERENCES `ems_order` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='退货单';

-- ----------------------------
-- Records of ems_retake
-- ----------------------------
BEGIN;
INSERT INTO `ems_retake` (`id`, `oid`, `des`, `audit_flag`) VALUES (2, 18, '测试原因', 0);
INSERT INTO `ems_retake` (`id`, `oid`, `des`, `audit_flag`) VALUES (3, 18, 'jjjsjs', 1);
INSERT INTO `ems_retake` (`id`, `oid`, `des`, `audit_flag`) VALUES (4, 23, NULL, 2);
COMMIT;

-- ----------------------------
-- Table structure for ems_warehouse
-- ----------------------------
DROP TABLE IF EXISTS `ems_warehouse`;
CREATE TABLE `ems_warehouse` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '仓库名称',
  `note` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '仓库描述',
  `state` tinyint(1) DEFAULT '1' COMMENT '仓库状态',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='仓库信息表';

-- ----------------------------
-- Records of ems_warehouse
-- ----------------------------
BEGIN;
INSERT INTO `ems_warehouse` (`id`, `name`, `note`, `state`) VALUES (1, '深圳口岸', '', 1);
INSERT INTO `ems_warehouse` (`id`, `name`, `note`, `state`) VALUES (2, '大连口岸', '', 1);
INSERT INTO `ems_warehouse` (`id`, `name`, `note`, `state`) VALUES (3, '黑河口岸', '', 1);
INSERT INTO `ems_warehouse` (`id`, `name`, `note`, `state`) VALUES (5, '上海口岸', '', 1);
COMMIT;

-- ----------------------------
-- Table structure for menu
-- ----------------------------
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` (
  `id` int NOT NULL AUTO_INCREMENT,
  `pattern` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `path` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `level` int DEFAULT NULL,
  `name` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `icon` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 'el-icon-menu',
  `parentId` int NOT NULL,
  `enable` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of menu
-- ----------------------------
BEGIN;
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (2, '/', '', 0, '用户管理', 'el-icon-user-solid', 1, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (6, '/employee/userList/**', '/userList', 1, '用户列表', 'el-icon-user', 2, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (7, '/staff/roleList/**', '/roleList', 1, '角色列表', 'el-icon-s-check', 2, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (8, '/staff/powList/**', '/powList', 1, '权限列表', 'el-icon-s-tools', 2, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (9, '/', '', 0, '仓库管理', 'el-icon-s-home', 1, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (10, NULL, '/order', 1, '入库管理', 'el-icon-menu', 9, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (11, '/goods/enterList/**', '/orderout', 1, '出库管理', 'el-icon-s-order', 9, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (12, '/', '', 0, '信息管理', 'el-icon-s-custom', 1, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (13, '/clientList', '/category', 1, '物品类别管理', 'el-icon-tickets', 12, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (14, '/product', '/product', 0, '商品管理', 'el-icon-s-order', 12, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (16, NULL, '/warehouse', 1, '仓库管理', 'el-icon-menu', 12, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (18, NULL, NULL, 0, '普通用户', 'el-icon-menu', 1, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (19, NULL, '/customer/input', 1, '入库单', 'el-icon-menu', 18, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (20, NULL, '/customer/output', 1, '出库单', 'el-icon-menu', 18, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (21, NULL, NULL, 0, '报单员', 'el-icon-menu', 1, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (22, NULL, '/auditor/input', 1, '入库单', 'el-icon-menu', 21, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (23, NULL, '/auditor/output', 1, '出库单', 'el-icon-menu', 21, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (24, NULL, '/customer/order/input', 1, '入库凭证', 'el-icon-menu', 18, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (25, NULL, '/customer/order/output', 1, '备货通知单', 'el-icon-menu', 18, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (26, NULL, NULL, 1, '退货单', 'el-icon-menu', 1, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (27, NULL, '/retake', NULL, '退货单', 'el-icon-menu', 26, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (28, NULL, '/clientList', 1, '客户管理', 'el-icon-menu', 12, 0);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (29, NULL, '/warehouse/move', NULL, '移库管理', 'el-icon-menu', 9, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (31, '/', NULL, 0, '报表分析', 'el-icon-menu', 1, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (32, NULL, '/order/analysis', 1, '客户分析', 'el-icon-menu', 31, 1);
INSERT INTO `menu` (`id`, `pattern`, `path`, `level`, `name`, `icon`, `parentId`, `enable`) VALUES (33, NULL, '/balance', 1, '库存查询', 'el-icon-menu', 31, 1);
COMMIT;

-- ----------------------------
-- Table structure for menu_role
-- ----------------------------
DROP TABLE IF EXISTS `menu_role`;
CREATE TABLE `menu_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `mid` int DEFAULT NULL,
  `rid` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `dm` (`mid`) USING BTREE,
  KEY `dr` (`rid`) USING BTREE,
  CONSTRAINT `dm` FOREIGN KEY (`mid`) REFERENCES `menu` (`id`) ON DELETE CASCADE,
  CONSTRAINT `dr` FOREIGN KEY (`rid`) REFERENCES `role` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=226 DEFAULT CHARSET=gb2312 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of menu_role
-- ----------------------------
BEGIN;
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (83, 18, 13);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (84, 25, 13);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (85, 24, 13);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (86, 20, 13);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (87, 19, 13);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (88, 26, 13);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (89, 27, 13);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (90, 21, 16);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (91, 23, 16);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (92, 22, 16);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (93, 26, 16);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (94, 27, 16);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (208, 31, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (209, 33, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (210, 32, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (211, 9, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (212, 29, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (213, 11, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (214, 10, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (215, 12, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (216, 14, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (217, 28, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (218, 16, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (219, 13, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (220, 2, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (221, 8, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (222, 7, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (223, 6, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (224, 26, 3);
INSERT INTO `menu_role` (`id`, `mid`, `rid`) VALUES (225, 27, 3);
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(32) CHARACTER SET gb2312 COLLATE gb2312_chinese_ci DEFAULT NULL,
  `nameZh` varchar(32) CHARACTER SET gb2312 COLLATE gb2312_chinese_ci DEFAULT NULL,
  `remark` varchar(128) CHARACTER SET gb2312 COLLATE gb2312_chinese_ci DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `nameZh` (`nameZh`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=gb2312 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` (`id`, `name`, `nameZh`, `remark`) VALUES (3, 'ROLE_warehouse', '超级管理员', '对管理系统可以进行更多的操作哦');
INSERT INTO `role` (`id`, `name`, `nameZh`, `remark`) VALUES (13, 'ROLE_aaa', '客户', '入库单、出库单');
INSERT INTO `role` (`id`, `name`, `nameZh`, `remark`) VALUES (16, 'ROLE_Declaration', '报单员', '报单员');
INSERT INTO `role` (`id`, `name`, `nameZh`, `remark`) VALUES (17, 'ROLE_分拣员', '分拣员', '分拣员');
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'hrID',
  `name` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '姓名',
  `phone` char(11) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '手机号码',
  `email` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '邮箱',
  `roleName` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '角色名称',
  `enabled` tinyint(1) DEFAULT '1',
  `username` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '用户名',
  `password` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '密码',
  `userface` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `remark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `sex` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '性别',
  `age` int DEFAULT NULL COMMENT '年龄',
  `tel` int DEFAULT NULL COMMENT '电话',
  `address` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '地址',
  `status` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '身份',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` (`id`, `name`, `phone`, `email`, `roleName`, `enabled`, `username`, `password`, `userface`, `remark`, `sex`, `age`, `tel`, `address`, `status`) VALUES (1, '234', '14616788991', 'pqz@163.com', '超级管理员', 0, 'admin', 'a1bb09ad5dea12e0f94762cb116c447e80c784d8aa2c6625263f7f3436cdd583', 'http://localhost:8181/uploadFile/2020/04/29/22543b71-a7ff-4571-b0a5-65e630e14c1e.JPG', NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `user` (`id`, `name`, `phone`, `email`, `roleName`, `enabled`, `username`, `password`, `userface`, `remark`, `sex`, `age`, `tel`, `address`, `status`) VALUES (34, '肉肉', '17863671788', '1204216126@qq.com', '普通用户', 1, 'rourou', 'a1bb09ad5dea12e0f94762cb116c447e80c784d8aa2c6625263f7f3436cdd583', 'http://localhost:8181/uploadFile/2022/01/13/4156d4d8-045c-4386-8652-a50b1df64e53.jpg', '', NULL, NULL, NULL, NULL, NULL);
INSERT INTO `user` (`id`, `name`, `phone`, `email`, `roleName`, `enabled`, `username`, `password`, `userface`, `remark`, `sex`, `age`, `tel`, `address`, `status`) VALUES (35, '丢丢', '17863671816', 'haha@163.com', '报单员', 1, 'diudiu', 'a1bb09ad5dea12e0f94762cb116c447e80c784d8aa2c6625263f7f3436cdd583', NULL, '', NULL, NULL, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uid` int DEFAULT NULL,
  `rid` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `deu` (`uid`) USING BTREE,
  KEY `der` (`rid`) USING BTREE,
  CONSTRAINT `der` FOREIGN KEY (`rid`) REFERENCES `role` (`id`) ON DELETE CASCADE,
  CONSTRAINT `deu` FOREIGN KEY (`uid`) REFERENCES `user` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=gb2312 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of user_role
-- ----------------------------
BEGIN;
INSERT INTO `user_role` (`id`, `uid`, `rid`) VALUES (50, 1, 3);
INSERT INTO `user_role` (`id`, `uid`, `rid`) VALUES (64, 34, 13);
INSERT INTO `user_role` (`id`, `uid`, `rid`) VALUES (66, 35, 16);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
